package com;

import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import com.bean.Admin;
import com.opensymphony.xwork2.ActionSupport;
import com.service.AdminService;


public class LogoutAction extends ActionSupport
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Resource(type=Admin.class)
	private Admin admin;
	
	@Autowired
	@Qualifier("adminService")
	private AdminService adminService;
	
	@Override
	public String execute() throws Exception
	{
		if(adminService.logout())
		{
			return LOGIN;
		}
		else
		{
			return ERROR;
		}
	}
}
